package com.charity.service.serviceImpl;

import com.charity.mapper.AdvertisementMapper;
import com.charity.pojo.Advertisement;
import com.charity.service.AdvertisementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdvertisementServiceImpl implements AdvertisementService {

    @Autowired
    private AdvertisementMapper advertisementMapper;

    @Override
    public List<Advertisement> advertisements() {
        return advertisementMapper.advertisements();
    }

    @Override
    public Advertisement advertisement(Integer no) {
        return advertisementMapper.advertisement(no);
    }

    @Override
    public Integer updateAdvertisement(Integer no, String title, String content) {
        return advertisementMapper.updateAdvertisement(no, title, content);
    }

    @Override
    public Integer addAdvertisement(String title, String content, String createDate) {
        return advertisementMapper.addAdvertisement(title, content, createDate);
    }

    @Override
    public Integer deleteAdvertisement(Integer no) {
        return advertisementMapper.deleteAdvertisement(no);
    }
}
